package handler;

import java.util.List;

import com.google.gson.Gson;

import bean.Producer;
import dao.ProducerDao;

public class LoadProducerHandler implements IHandler{

	@Override
	public String process() {
		List<Producer> producers;
		try {
			producers = ProducerDao.getProducers();
		} catch (Exception e) {
			return "Error on getProducers : "+ e.getMessage();
		}
		String data = "{\"identifier\": \"id\", \"items\": "+new Gson().toJson(producers)+"}";
    	return data;
	}

}
